#!/bin/csh

# ---------------------------
# Setup for OSS installation.
# ---------------------------

# Check for launch directory

set LAN = /opt/ngat/bin
set OSS_EXEC = /occ/oss/scripts

if (! -e $LAN) then
	echo "Launch directory: [ $LAN ] not found, you may need to run occ_setup "
	exit 1
endif

if (! -e $LAN/osx) then
    /bin/cp -fv $OSS_EXEC $LAN/osx
endif

if (! -e $LAN/osw) then
    /bin/cp -fv $OSS_EXEC/osw $LAN/osw
endif

if (! -e $LAN/osx_setup) then
    /bin/cp -fv $OSS_EXEC/osx_setup $LAN/osx_setup
endif

if (! -e $LAN/osw_init) then
    /bin/cp -fv $OSS_EXEC/osw_init $LAN/osw_init
endif

# Copy the Phase2 jyd files up one.
/bin/cp -fv /occ/oss/config/jydodb.properties /occ/oss
/bin/cp -fv /occ/oss/config/jydodb.key        /occ/oss

# Create and initialize the conditions file.
touch /occ/tmp/.conditions
echo "extinction=SPECTROGRAPHIC" >> /occ/tmp/.conditions
echo "manual.photom" >> /occ/tmp/.conditions

echo "Done OSS setup - you may still need to"
echo " - install a phase2-ODB tar into /occ/oss "
echo " - setup links in /etc/init.d /etc/rcN.d to the osw_init script"
